/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.general.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.cip.esymons.colegiatura.be.Colegiado;

/**
 *
 * @author ADMINISTRADOR
 */
@Entity
@Table(name = "gen_HistorialConexion")
//@NamedQueries({
//    @NamedQuery(name = "HistorialConexion.findAll", query = "SELECT h FROM HistorialConexion h"),
//    @NamedQuery(name = "HistorialConexion.findByHcoCodigo", query = "SELECT h FROM HistorialConexion h WHERE h.hcoCodigo = :hcoCodigo"),
//    @NamedQuery(name = "HistorialConexion.findByHcoIp", query = "SELECT h FROM HistorialConexion h WHERE h.hcoIp = :hcoIp"),
//    @NamedQuery(name = "HistorialConexion.findByHcoHost", query = "SELECT h FROM HistorialConexion h WHERE h.hcoHost = :hcoHost"),
//    @NamedQuery(name = "HistorialConexion.findByHcofechaConexion", query = "SELECT h FROM HistorialConexion h WHERE h.hcofechaConexion = :hcofechaConexion")})
public class HistorialConexion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "hco_codigo")
    private Integer hcoCodigo;
    @Column(name = "hco_ip")
    private String hcoIp;
    @Column(name = "hco_host")
    private String hcoHost;
    @Basic(optional = false)
    @Column(name = "hco_fechaConexion")
    @Temporal(TemporalType.DATE)
    private Date hcofechaConexion;
    @Column(name = "hco_clave")
    private String hcoClave;    
    @Column(name = "hco_horaInicio")
    private String hcoHoraInicio;
    @Column(name = "hco_horaFin")
    private String hcoHoraFin;
    @JoinColumn(name = "gue_codigo", referencedColumnName = "gue_Codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private UsuarioExterno gueCodigo;

    public HistorialConexion() {
    }

    public HistorialConexion(Integer hcoCodigo) {
        this.hcoCodigo = hcoCodigo;
    }

    public HistorialConexion(Integer hcoCodigo, Date hcofechaConexion) {
        this.hcoCodigo = hcoCodigo;
        this.hcofechaConexion = hcofechaConexion;
    }

    public Integer getHcoCodigo() {
        return hcoCodigo;
    }

    public void setHcoCodigo(Integer hcoCodigo) {
        this.hcoCodigo = hcoCodigo;
    }

    public String getHcoIp() {
        return hcoIp;
    }

    public void setHcoIp(String hcoIp) {
        this.hcoIp = hcoIp;
    }

    public String getHcoHost() {
        return hcoHost;
    }

    public void setHcoHost(String hcoHost) {
        this.hcoHost = hcoHost;
    }

    public Date getHcofechaConexion() {
        return hcofechaConexion;
    }

    public void setHcofechaConexion(Date hcofechaConexion) {
        this.hcofechaConexion = hcofechaConexion;
    }

    public UsuarioExterno getGueCodigo() {
        return gueCodigo;
    }

    public void setGueCodigo(UsuarioExterno gueCodigo) {
        this.gueCodigo = gueCodigo;
    }

    public String getHcoClave() {
        return hcoClave;
    }

    public void setHcoClave(String hcoClave) {
        this.hcoClave = hcoClave;
    }

    public String getHcoHoraFin() {
        return hcoHoraFin;
    }

    public void setHcoHoraFin(String hcoHoraFin) {
        this.hcoHoraFin = hcoHoraFin;
    }

    public String getHcoHoraInicio() {
        return hcoHoraInicio;
    }

    public void setHcoHoraInicio(String hcoHoraInicio) {
        this.hcoHoraInicio = hcoHoraInicio;
    }



    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hcoCodigo != null ? hcoCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistorialConexion)) {
            return false;
        }
        HistorialConexion other = (HistorialConexion) object;
        if ((this.hcoCodigo == null && other.hcoCodigo != null) || (this.hcoCodigo != null && !this.hcoCodigo.equals(other.hcoCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.general.be.HistorialConexion[hcoCodigo=" + hcoCodigo + "]";
    }


    @Transient
    Colegiado colegiado;

    public Colegiado getColegiado() {
        return colegiado;
    }

    public void setColegiado(Colegiado colegiado) {
        this.colegiado = colegiado;
    }

    
}
